import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException.Code;

/**
 * The PoolCreator class
 *
 * @author  Joshua Kwan
 */

public class PoolCreator {


    /** znode paths for this class **/
    public static final String JOBPOOL_PATH = "/jobpool";
    public static final String WORKERPOOL_PATH = "/workerpool";
    public static final String FILEPOOL_PATH = "/filepool";
    
//    PoolCreator.createPool(zkc, PoolCreator.JOBPOOL_PATH);
    	
    /**
     * Creates the zNode specified pool in the system.
     */
    public static void createPool(ZkConnector zkc, String path){
        if (zkc.exists(path, false) == null){
        	Code dat = zkc.create(path, null, CreateMode.PERSISTENT);
        	if (dat == Code.OK) System.out.println("PoolCreator: " + path + " created.");
        	else System.out.println("PoolCreator: " + path + "  " + dat);
        }
    }
}    